//
//  EdudescController.m
//  iBaby365v2
//
//  Created by admin on 14/12/5.
//  Copyright (c) 2014年 suplus. All rights reserved.
//

#import "EdudescController.h"
#import "SPEducation.h"
#import "SPEdudescFrame.h"
#import "EdudescCell.h"

@interface EdudescController ()

/**
 *  存放所有cell的frame模型数据
 */
@property (nonatomic, strong) NSArray *edudescFrames;

@end

@implementation EdudescController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.separatorStyle = UITableViewCellAccessoryNone;
    
}
-(NSArray *)edudescFrames
{
    if (_edudescFrames == nil) {
        NSMutableArray *edudescFrameArray = [NSMutableArray array];
        SPEdudescFrame *edudescFrame = [[SPEdudescFrame alloc]init];
        edudescFrame.education = self.speducation;
        [edudescFrameArray addObject:edudescFrame];
        _edudescFrames = edudescFrameArray;
    }
    return _edudescFrames;
}

#pragma mark - Table view data source


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

       return self.edudescFrames.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    EdudescCell *cell = [EdudescCell cellWithTableView:tableView];
    cell.educationFrame = self.edudescFrames[indexPath.row];
    cell.selectionStyle = UITableViewCellAccessoryNone;
    
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    SPEdudescFrame *spedudescFrame = self.edudescFrames[indexPath.row];
    return spedudescFrame.cellHight;
}


@end
